<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>

<h2><?php echo $this->lang->line( 'upload_structure' ); ?></h2>
<p><?php echo $this->lang->line( 'upload_intro' ); ?></p>

<p>Actual folder: <?php echo $folder_name; ?></p>
<p>Actual path: <?php echo $path; ?></p>  
<?php echo form_open( 'article/user/upload/create_folder' ); ?>
Create folder:<br />
Title: <?php echo form_input( 'title' ); ?>
<?php echo form_hidden( 'folder_id', $folder_id );?>
<?php echo form_submit( 'submit', 'Submit' );?>
<?php echo form_close( ); ?>
<hr />
<div class="buttons">                
	<a href="<?php print site_url( 'article/user/upload/form/' . $folder_id )?>">
    <?php print $this->bep_assets->icon( 'add' );?>
    <?php print $this->lang->line( 'upload_new_files' )?>
    </a>
</div>
<hr style="clear:both;"/>
<ul class="media">
<?php foreach( $folder->result_array( ) as $row ){ ?>
	<li class="folder">
		<?php echo anchor( "article/user/upload/index/".$row['id'], $row['title'] ); ?>
		<?php echo anchor( "article/user/upload/delete/".$row['id'], $this->bep_assets->icon( 'delete' ) ); ?> - 
		<?php echo $this->bep_assets->icon( 'pencil' ); ?>
	</li>
<?php } ?>
<?php foreach( $files->result_array( ) as $row ){ ?>
	<li class="file">
		<img src="<?php echo $path.$row['name']; ?>" width="150">
		<?php echo $row['title']; ?>
		<?php echo anchor( "article/user/upload/delete_file/".$row['id'], $this->bep_assets->icon( 'delete' ) ); ?> -
		<?php echo $this->bep_assets->icon( 'pencil' ); ?>
	</li>
<?php } ?>
</ul>